package org.jeecg.modules.simulator.jsonot;

import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;

/**
 * @program: simulator-b20240918
 * @description: 各站人员OD分配概率
 * @author: renzhg
 * @create: 2024-10-04 16:25
 **/
@Data
public class ODProbabilityApiInfo implements Comparable<ODProbabilityApiInfo>{
    @TableField(value = "o_station_id")
    String oStationId;
    @TableField(value = "o_station_name")
    String oStationName;
    @TableField(value = "d_station_id")
    String dStationId;
    @TableField(value = "d_station_name")
    String dStationName;
    @TableField(value = "route_id")
    String routeId;
    @TableField(value = "pasgr_num")
    String pasgrNum;
    @TableField(value = "route_rate")
    String routeRate;

    @Override
    public int compareTo(ODProbabilityApiInfo other) {
        if (other == null) {
            return 1; // this is greater than null
        }
        // Assuming routeRate represents a number in String format, convert to Double for comparison
        Double thisRate = Double.valueOf(this.routeRate);
        Double otherRate = Double.valueOf(other.routeRate);
        return thisRate.compareTo(otherRate);
    }
}
